<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/style.css" />
		<link rel="stylesheet" href="../css/iconfont.css " />
		<link href="../css/calendar/calendar.css" rel="stylesheet"/>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav ding-bar">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">电梯管理</h1>
		</header>
		<div class="mui-content">
		    <div id="tabbar" class="mui-control-content mui-active">
		    	<div style="background: #fff;border-radius: 0.3rem;width: ;padding-bottom: 0.2rem;width: 95%;margin:0.3rem auto 0px;box-shadow: 1px 1px 3px #cbcdd2,-1px -1px 3px #cbcdd2;">
		    		<div id="date" ></div>
		    		<div class="biaoji">
		    			<div class="yby"><span></span>已保养</div>
		    			<div class="dby"><span></span>待保养</div>
		    			<div class="yq"><span></span>逾期</div>
		    			<div class="dqrq"><span></span>当前日期</div>
		    		</div>
		    	</div>
		    	<div class="gl-icon">
		    		<h1 class="gl-icon-t"><span></span><div>工单管理</div></h1>
		    		<ul class="gl-icon-list">
		    			<li><a data-href="yiwancheng.html">
			    				<img  src="../images/dtgl-icon1.png"/>
			    				<span>已完成</span>
		    			    </a>
		    			</li>
		    			<li>
		    				<a data-href="weiwancheng.html">
			    				<img  src="../images/dtgl-icon2.png"/>
			    				<span>未完成</span>
			    			</a>
		    			</li>
		    			<li><a data-href="chaoqi.html">
		    				<img  src="../images/dtgl-icon2-07.png"/>
		    				<span>超期</span>
		    			</a></li>
		    			<li><a data-href="jixiu.html">
		    				<img  src="../images/dtgl-icon4.png"/>
		    				<span>急修</span>
		    			</a></li>
		    		</ul>
		    	</div>
		    	<div class="gl-icon">
		    		<h1 class="gl-icon-t"><span></span><div>小工具</div></h1>
		    		<ul class="gl-icon-list">
		    			<li><a data-href="daka.html">
		    				<img  src="../images/dtgl-icon5.png"/>
		    				<span>考勤打卡</span>
		    			</a data-href="gonggao.html"></li>
		    			<li><a data-href="gonggao.html">
		    				<img  src="../images/dtgl-icon6.png"/>
		    				<span>公司公告</span>
		    			</a></li>
		    			
		    		</ul>
		    	</div>
		    </div>
		    <footer>
				<nav class="mui-bar mui-bar-tab guanli-footer">
					<a class="mui-tab-item mui-active" id="gongzuo">
						<span class="mui-icon  iconfont icon-gongzuoshi-active"></span>
						<span class="mui-tab-label ">工作</span>
					</a>
					<a class="mui-tab-item " data-href="tongzhi.html" id="tongzhi">
						<span class="mui-icon iconfont icon-tongzhi"></span>
						<span class="mui-tab-label">通知</span>
					</a>
					<a class="mui-tab-item" data-href="gerenzhongxin.html" id="wode">
						<span class="mui-icon iconfont icon-Personal"></span>
						<span class="mui-tab-label">我的</span>
					</a>
				</nav>
			</footer>
		</div>
		<script src="../js/jquery-1.8.0.min.js"></script>
		<script src="../js/mui.min.js"></script>
		<script type="text/javascript" src="../js/head_public.js" ></script>
		<script type="text/javascript" src="../js/common.js" ></script>
		<script type="text/javascript" src="../js/session.js" ></script>
		<script type="text/javascript" src="../css/calendar/calendar.js" charset="utf-8"></script>
		<script>
			// $("footer").load("footer1.html")
			mui(".mui-content").on("tap","a[data-href]",function(){
				location.href=$(this).attr("data-href");
//				mui.openWindow({url:$(this).attr("data-href")})
			})
		</script>
		<script type="text/javascript">
			mui.init()
				//获取当前日期
		    var nowdate = new Date();
		    var year = nowdate.getFullYear();
		    var month = nowdate.getMonth()+1;
		    var day = nowdate.getDate();
		    var nowtime = year+"-"+month+"-"+day;
		    var yuangongid="";
			function writeDay(n) //据条件写日期的下拉框
		   {
			   var e = document.reg_testdate.DD; optionsClear(e);
			   for (var i=1; i<(n+1); i++)
			        e.options.add(new Option( i +'日', i));
		   }
		   function IsPinYear(year)//判断是否闰平年
		   {     return(0 == year%4 && (year%100 !=0 || year%400 == 0));}
		   function optionsClear(e)
		   {
		        e.options.length = 1;
		   }
			$('.item-buydate').mdater({maxDate: new Date,minDate: new Date(1900, 0, 1)});
			
		</script>
		<script>
			$(function(){
			   getdata();
			})
			
			function getdata(){
//				判断登录
                 var work_id=getCookie("workid");
                 var work=getCookie("work");
                 var userid=getCookie("userid");
                 if(userid==""||userid==null){
                 	alert("您还没有登录，请先登录")
                 	location.href="../public/login.html";
                 }else{
                 	if(work!="2"){
						alert("您不是维保人员,您没有权限")
						mui.openWindow({url:"../public/index.html"})
					}
                 	var param={};
                 	param.work_id=work_id;
                 	param.member_id=userid;
                 	param.member_work=work;
                 	$(".mui-content").on("tap","#gongzuo",function(){
		         		if(work=="1"){
		         			location.href="guanliindex.html"
//		         			mui.openWindow({url:"guanliindex.html"})
		         		}else if(work=="2"){
		         			location.href="index.html"
//		         			mui.openWindow({url:"index.html"})
		         		}else{
		         			location.href="../public/index.html"
//		         			mui.openWindow({url:"../public/index.html"})
		         		}	
					})
                 	$.post(net+"/public/index.php?s=api/elevator",param,function(res){
                 		if(res.code=="200"){
                 			if(res.result!=null&&res.result.length!=0){
                 				var yeartag=$(".yeartag").html();
                 				var monthtag=$(".monthtag").html();
                 				var monstr=monthtag.substring(0,monthtag.length-1);
                 				$.each(res.result,function(){
                 					var $mouth="";
                 					if(this.mouth.indexOf("0")==0){
	                 					$mouth=this.mouth.substring(1,this.mouth.length);
	                 				}else{
	                 					$mouth=this.mouth;
	                 				}
                 					var $day="";
                 					if(this.day.indexOf("0")==0){
	                 					$day=this.day.substring(1,this.day.length);
	                 				}else{
	                 					$day=this.day;
	                 				}
                 					var status=this.status;
	                 				if(yeartag==this.year&&monstr==$mouth){
	                 					$('.md_datearea li').not('.prevdate,.nextdate').each(function(){
	                 						var day=$(this).html();
	                 						if(day==$day){
	                 							if(status==1){	
	                 								$(this).css("background","#ffcccc")
	                 							}else if(status==2){
	                 								$(this).css("background","#cccccc")
	                 							}else if(status==-1){
	                 								$(this).css("background","#ffea95")
	                 							}
	                 						}
	                 					})
	                 				}
                 				})
	                 		}
                 		}
                 		
                 	})
                 }
			}
		</script>
	</body>

</html>